import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by JiaJia on 2019/4/10 0010.
 */
public class HuaWeiShiXi {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        StringBuilder sb=new StringBuilder();
        while (sc.hasNext()){
            String[] input=sc.nextLine().split(" ");
            int n=Integer.parseInt(input[0]);
            for (int i = n; i >=1 ; i--) {
                stringAddtion(sb,input[i]);
            }
            String[] output=sb.toString().split(" ");
            Arrays.sort(output);
            for(String s:output){
                System.out.print(s+" ");
            }
        }
        sc.close();
    }

    private static void stringAddtion(StringBuilder sb,String str){
        if(str==null||str.length()<1){
            return;
        }
        int p=0;
        while ((p +=8)<str.length()){
            sb.append(str.substring(p-8,p)).append(" ");
        }
        if(str.length()<=p){
            sb.append(str.substring(p-8,str.length()));
            for (int i = str.length(); i <p ; i++) {
                sb.append(0);
            }
            sb.append(" ");
        }

    }

}